# Maintainer: David Runge <dvzrv@archlinux.org>

_name=flufl.lock
pkgname=python-flufl-lock
pkgver=7.1.1
pkgrel=2
pkgdesc="NFS-safe file locking with timeouts for POSIX systems for Python"
arch=(any)
url="https://gitlab.com/warsaw/flufl.lock"
license=(Apache)
depends=(python-atpublic python-psutil)
makedepends=(python-build python-installer python-pdm-pep517)
checkdepends=(python-pytest python-sybil)
source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz)
sha512sums=('eb9d8a80013ca07cc3eaab30ced596c0362cfc59d5a1f7cf17aacbf4068d9989b443df7e2d5f5e09d6f60e0ebc784ab1897ca7379fde7eeb57246cb6b5dfef3f')
b2sums=('813b4b77fe2b7c9d7125e9d4a5530a77aa4205e1eb0a90852419f29669db97c683fe1d73d221bc7490a7a827da24e23bfac38002c1e6a179289b56b59e2d4dfa')

build() {
  cd $_name-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_name-$pkgver
  export PYTHONPATH="src:$PYTHONPATH"
  pytest -vv -c /dev/null
}

package() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 README.rst -t "$pkgdir/usr/share/doc/$pkgname/"
}
